def function(var):
    if var<1:
        var=var
    elif (1<=var and var<10):
        var=2*var-1
    else:
        var=3*var-11
    return var
print(function(int(input("请输入："))))